<template>
    <h1>父组件</h1>
    <h1>{{ dom }}</h1>
    <button @click="dom.getNum(1)">点击执行</button>
    <hr>
    <sub-com ref="dom"></sub-com>

</template>
<!-- 在script标签上 写入setup 就是 setup入口函数的语法糖  -->
<script setup>
import SubCom from './components/Sub5.vue'
import {ref , onMounted, computed, nextTick} from 'vue'
let dom = ref(null)



// onMounted(()=>{
//     console.log(dom.value);
//     console.log(dom.value.num);
//     console.log(dom.value.getNum);
// })

// let a = ref(null)
// const  getA = async ()=>{
//    let res = await  computed(async ()=>{
//         await nextTick()
//         return dom.value.num
//     }).value
//     console.log(res);
//     a.value = res
// }


</script>
<script>
export default {
name: 'App',
}
</script>
